﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Resources;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Web.Mvc;
using System.Web;
using HelloMinasan.Domain;

namespace HelloMinasan.Web.Song.ViewModels
{
    public class EditUserModel
    {
        [HiddenInput]
        public int UserId { get; set; } 

        [ReadOnly(true)]
        [Display(Name="User Name")]
        [DataType(DataType.Text)]
        public string Username { get; set; }

        //[Required(ErrorMessageResourceType = typeof(Language_en), ErrorMessageResourceName = "Email_Required")]
        //[RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessageResourceType = typeof(Language_en), ErrorMessageResourceName = "Email_RegularExpression")]
        //[DataType(DataType.EmailAddress)]
        //[Display(Name = "Email address")]
        [Required]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
        [Display(Name = "BirthDay")]
        public DateTime DateOfBirth { get; set; }

        [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Date, ErrorMessage="{0} not is date format!")]
        [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [Display(Name = "Confirm password")]
        [System.Web.Mvc.Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
                                                    
        [DataType(DataType.MultilineText)]
        [StringLength(300)]
        [Display(Name = "Descriptions")]
        public string Descriptions { get; set; }

        [Display(Name = "Avartar")]
        public string Avatar { get; set; }

        [Display(Name = "LastAccess")]
        public DateTime LastAccess { get; set; }

        public int Score { get; set; }

        [Display(Name = "User Status")]
        public string UserStatus { get; set; }

        [HiddenInput]
        [Display(Name = "Total Songs")]
        public int TotalSongs { get; set; }

        [HiddenInput]
        public int TotalTest { get; set; }

        public IEnumerable<UserNote> UserNotes { get; set; }

        public HttpPostedFileBase ImageFile { get; set; }

        [Display(Name = "Full name")]
        public string Fullname { get; set; }
    }
}
